package com.jeesite.modules.interfacelogs.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jakarta.validation.constraints.Size;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 接口日志Entity
 * @author 码脑洞
 * @version 2025-04-13
 */
@Table(name="t_interface_logs", alias="a", label="接口日志信息", columns={
		@Column(name="auto_id", attrName="autoId", label="主键", isPK=true),
		@Column(name="org_id", attrName="orgId", label="组织ID", isQuery=false, isUpdateForce=true),
		@Column(name="org_code", attrName="orgCode", label="组织编码", isQuery=false),
		@Column(name="org_name", attrName="orgName", label="组织名称", isQuery=false),
		@Column(name="bill_type", attrName="billType", label="单据类型"),
		@Column(name="interface_name", attrName="interfaceName", label="接口名称", queryType=QueryType.LIKE),
		@Column(name="source_system", attrName="sourceSystem", label="来源系统", isQuery=false),
		@Column(name="target_system", attrName="targetSystem", label="目标系统", isQuery=false),
		@Column(name="interface_mode", attrName="interfaceMode", label="接口方式", comment="接口方式(IN:引入  OUT: 输出)", isQuery=false),
		@Column(name="interface_url", attrName="interfaceUrl", label="接口地址", isQuery=false),
		@Column(name="input_params", attrName="inputParams", label="输入参数", isQuery=false),
		@Column(name="output_params", attrName="outputParams", label="输出参数", isQuery=false),
		@Column(name="exception_info", attrName="exceptionInfo", label="异常信息", isQuery=false),
		@Column(name="source_id", attrName="sourceId", label="来源ID", isQuery=false),
		@Column(name="source_no", attrName="sourceNo", label="来源单号", queryType=QueryType.LIKE),
		@Column(name="call_start_time", attrName="callStartTime", label="调用开始时间", isQuery=false, isUpdateForce=true),
		@Column(name="call_end_time", attrName="callEndTime", label="调用结束时间", isQuery=false, isUpdateForce=true),
		@Column(name="interface_status", attrName="interfaceStatus", label="接口状态", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注", isQuery=false),
		@Column(name="create_by", attrName="createBy", label="创建人", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新人", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false),
	}, orderBy="a.update_date DESC"
)
public class InterfaceLogs extends DataEntity<InterfaceLogs> {
	
	private static final long serialVersionUID = 1L;
	private Long autoId;		// 主键
	private Long orgId;		// 组织ID
	private String orgCode;		// 组织编码
	private String orgName;		// 组织名称
	private String billType;		// 单据类型
	private String interfaceName;		// 接口名称
	private String sourceSystem;		// 来源系统
	private String targetSystem;		// 目标系统
	private String interfaceMode;		// 接口方式(IN:引入  OUT: 输出)
	private String interfaceUrl;		// 接口地址
	private String inputParams;		// 输入参数
	private String outputParams;		// 输出参数
	private String exceptionInfo;		// 异常信息
	private String sourceId;		// 来源ID
	private String sourceNo;		// 来源单号
	private Date callStartTime;		// 调用开始时间
	private Date callEndTime;		// 调用结束时间
	private String interfaceStatus;		// 接口状态

	public InterfaceLogs() {
		this(null);
	}
	
	public InterfaceLogs(String id){
		super(id);
	}
	
	@JsonSerialize(using = ToStringSerializer.class)
	public Long getAutoId() {
		return autoId;
	}

	public void setAutoId(Long autoId) {
		this.autoId = autoId;
	}
	
	public Long getOrgId() {
		return orgId;
	}

	public void setOrgId(Long orgId) {
		this.orgId = orgId;
	}
	
	@Size(min=0, max=10, message="组织编码长度不能超过 10 个字符")
	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}
	
	@Size(min=0, max=30, message="组织名称长度不能超过 30 个字符")
	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	
	@Size(min=0, max=255, message="单据类型长度不能超过 255 个字符")
	public String getBillType() {
		return billType;
	}

	public void setBillType(String billType) {
		this.billType = billType;
	}
	
	@Size(min=0, max=100, message="接口名称长度不能超过 100 个字符")
	public String getInterfaceName() {
		return interfaceName;
	}

	public void setInterfaceName(String interfaceName) {
		this.interfaceName = interfaceName;
	}
	
	@Size(min=0, max=30, message="来源系统长度不能超过 30 个字符")
	public String getSourceSystem() {
		return sourceSystem;
	}

	public void setSourceSystem(String sourceSystem) {
		this.sourceSystem = sourceSystem;
	}
	
	@Size(min=0, max=30, message="目标系统长度不能超过 30 个字符")
	public String getTargetSystem() {
		return targetSystem;
	}

	public void setTargetSystem(String targetSystem) {
		this.targetSystem = targetSystem;
	}
	
	@Size(min=0, max=30, message="接口方式长度不能超过 30 个字符")
	public String getInterfaceMode() {
		return interfaceMode;
	}

	public void setInterfaceMode(String interfaceMode) {
		this.interfaceMode = interfaceMode;
	}
	
	@Size(min=0, max=255, message="接口地址长度不能超过 255 个字符")
	public String getInterfaceUrl() {
		return interfaceUrl;
	}

	public void setInterfaceUrl(String interfaceUrl) {
		this.interfaceUrl = interfaceUrl;
	}
	
	public String getInputParams() {
		return inputParams;
	}

	public void setInputParams(String inputParams) {
		this.inputParams = inputParams;
	}
	
	public String getOutputParams() {
		return outputParams;
	}

	public void setOutputParams(String outputParams) {
		this.outputParams = outputParams;
	}
	
	public String getExceptionInfo() {
		return exceptionInfo;
	}

	public void setExceptionInfo(String exceptionInfo) {
		this.exceptionInfo = exceptionInfo;
	}
	
	@Size(min=0, max=64, message="来源ID长度不能超过 64 个字符")
	public String getSourceId() {
		return sourceId;
	}

	public void setSourceId(String sourceId) {
		this.sourceId = sourceId;
	}
	
	@Size(min=0, max=100, message="来源单号长度不能超过 100 个字符")
	public String getSourceNo() {
		return sourceNo;
	}

	public void setSourceNo(String sourceNo) {
		this.sourceNo = sourceNo;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
	public Date getCallStartTime() {
		return callStartTime;
	}

	public void setCallStartTime(Date callStartTime) {
		this.callStartTime = callStartTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
	public Date getCallEndTime() {
		return callEndTime;
	}

	public void setCallEndTime(Date callEndTime) {
		this.callEndTime = callEndTime;
	}
	
	@Size(min=0, max=30, message="接口状态长度不能超过 30 个字符")
	public String getInterfaceStatus() {
		return interfaceStatus;
	}

	public void setInterfaceStatus(String interfaceStatus) {
		this.interfaceStatus = interfaceStatus;
	}
	
}